 package srdb.migration.schema.metadata;
 
 public class ObjectType extends DBObject
 {
   private String name = null;
   private TYPE type = TYPE.OBJECT;
   private Schema parentSchema = null;
 
   private String body = "";
 
   public ObjectType(String name) {
     this.name = name;
   }
 
   public String getName() {
     return this.name;
   }
 
   public void setType(TYPE type) {
     this.type = type;
   }
 
   public TYPE getType() {
     return this.type;
   }
 
   public void setDetails(Schema parentSchema, String type) {
     this.parentSchema = parentSchema;
 
     if (type.equalsIgnoreCase("OBJECT"))
       this.type = TYPE.OBJECT;
     else if (type.equalsIgnoreCase("COLLECTION"))
       this.type = TYPE.COLLECTION;
   }
 
   public void replaceBody(String body)
   {
     this.body = body;
   }
 
   public void setBody(String body)
   {
     this.body += body;
   }
 
   public String getBody()
   {
     return this.body;
   }
 
   public DBObject getParent()
   {
     return null;
   }
 
   public String getSchema()
   {
     return this.parentSchema != null ? this.parentSchema.getName() : null;
   }
 
   public static enum TYPE
   {
     OBJECT, 
     COLLECTION;
 
     public String toString()
     {
       String value = null;
       switch (ObjectType.TYPE.values()[ordinal()]) {
       case OBJECT:
         value = "OBJECT";
         break;
       case COLLECTION:
         value = "COLLECTION";
       }
 
       return value;
     }
   }
 }

/* 

 * 
 */